{% extends 'base.html' %}

{% block page_title %}Dashboard{% endblock page_title %}

{% block content %}
<h2>Your Projects</h2>
{% if user.project_set.count %}
{% for project in user.project_set.all %}
<p><a href="{{ project.get_absolute_url }}">{{ project }}</a></p>
{% endfor %}
{% else %}
<p>Why not join a <a href="{% url project_list %}">project</a> or create one of your own?</p>
{% endif %}


<h2>Your Tasks</h2>
{% if user.assigned_issues.count %}
{% for issue in user.assigned_issues.all|slice:":5" %}
  <p><a href="{{ issue.get_absolute_url }}">{{ issue }}</a> for the project "<a href="{{ issue.project.get_absolute_url }}">{{ issue.project }}</a>"</p>
{% endfor %}
{% else %}
<p>You do not have any pending tasks. How nice for you!</p>
{% endif %}
{% endblock content %}